#include "tankmessage.h"

configuration RobotMessageDispatcherC {
	uses {
		interface MainMotorControl;
		interface PeriphereControl;
	}
}

implementation {
	components MainC;
	
	components RobotMessageDispatcherP;
	RobotMessageDispatcherP.MainMotorControl = MainMotorControl;
	RobotMessageDispatcherP.PeriphereControl = PeriphereControl;

	components new AMSenderC(AM_TANK_RESPONSE_MSG) as SendResponse;

	components new AMReceiverC(AM_TANK_MOVE_MSG) as ReceiveMove;
	components new AMReceiverC(AM_TANK_PID_SETTINGS_MSG) as ReceiveSettings;
	components new AMReceiverC(AM_TANK_POWER_MSG) as ReceivePower;
//	components new AMReceiverC(AM_TANK_TOWER_MSG) as ReceiveTower;
	components new AMReceiverC(AM_TANK_SERVO_MSG) as ReceiveServo;

	components ActiveMessageC as AM;

/*
	components new SerialAMSenderC(AM_TANK_RESPONSE_MSG) as SendResponse;

	components new SerialAMReceiverC(AM_TANK_MOVE_MSG) as ReceiveMove;

	components new SerialAMReceiverC(AM_TANK_PID_SETTINGS_MSG) as ReceiveSettings;
	components new SerialAMReceiverC(AM_TANK_POWER_MSG) as ReceivePower;
	components new SerialAMReceiverC(AM_TANK_SERVO_MSG) as ReceiveServo;

	components SerialActiveMessageC as AM;
*/


//	components new TimerMilliC() as SensorTimerC;
//	RobotMessageDispatcherP.SensorTimer -> SensorTimerC;

	RobotMessageDispatcherP.Boot -> MainC.Boot;
	RobotMessageDispatcherP.AMControl -> AM;
	 
//	StdControl = GenericComm.Control;
//	StdControl = TankMessageDispatcherM.StdControl;

	RobotMessageDispatcherP.Packet -> AM;
	
	RobotMessageDispatcherP.ReceiveMove -> ReceiveMove;
	RobotMessageDispatcherP.ReceiveSettings -> ReceiveSettings;

	RobotMessageDispatcherP.ReceivePower -> ReceivePower;
//	RobotMessageDispatcherP.ReceiveTower -> ReceiveTower;
	RobotMessageDispatcherP.SendResponse -> SendResponse;


//	components TowerRotateC;
	
//	RobotMessageDispatcherP.TowerRotate -> TowerRotateC.TowerRotate;

	components LedsC;
	RobotMessageDispatcherP.Leds -> LedsC;
}
